#!/bin/bash

#处理中文乱码
export LANG="zh_CN.UTF-8"
export LC_ALL="zh_CN.UTF-8"

#收件箱
EMAIL_RECIVER=$1

#邮件标题
EMAIL_TITLE=$2

#邮件正文
EMAIL_CONTENT="$3"

echo "MailPushShellForQQ脚本文件开始发送邮件--->$EMAIL_RECIVER" >>commandLogs.txt

#打印一下
echo "邮件标题为: $EMAIL_TITLE" >>commandLogs.txt

#发送者邮箱
EMAIL_SENDER="root@kxfpfer.cn"

#邮件授权码(可选)
EMAIL_PASSWORD="root@kxfpfer.cn"

#附件路径
FILE1_PATH=$4

#执行发送邮件
sendEmail -f ${EMAIL_SENDER} -t ${EMAIL_RECIVER} -u ${EMAIL_TITLE} -xu ${EMAIL_SENDER} -xp ${EMAIL_PASSWORD} -m ${EMAIL_CONTENT} -a ${FILE1_PATH} -o message-charset=utf-8 -o message-content-type=html -o tls=no >>commandLogs.txt

#分割线
echo "----------------" >>commandLogs.txt